{# /StudX_dir/StudX/user/templates/user/user_item_list.html #}

{% load i18n %}

<tr>	
	<td>
		{% if user.is_active %}
			<span class="badge badge-pill badge-success">{% trans "Active" %}</span>
		{% else %}
			<span class="badge badge-pill badge-danger">{% trans "Inactive" %}</span>
		{% endif %}
	</td>
	<td>{{ user.username }}</td>
	<td>{{ user.first_name }}</td>
	<td>{{ user.last_name }}</td>
	<td>{% for group in user.groups.all %}{{ group }}{% endfor %}</td>
	<td>
		{% if user.classe_ownership.all %}
			{% for classe in user.classe_ownership.all %}
				<span class="badge badge-info">{{ classe}}</span>
			{% endfor %}
		{% else %} -
		{% endif %}
	</td>
	<td>{{ user.email }}</td>
	<td class="actions align-middle">
		<div class="btn-group btn-group-sm" role="group">
		{% if perms.user.change_user %}
			<a class="btn btn-outline-info btn-sm" href="{% url 'user:edit_user' user.id %}"><i class="fas fa-pencil-alt"></i></a>
		{% endif %}
		{% if perms.user.delete_user %}
			<a class="btn btn-outline-info btn-sm" data-toggle="modal" data-target="#UserDeleteModal" href="#"><i class="fas fa-trash-alt"></i></a>
		{% endif %}
		</div>
		{% include 'user/user_delete_modal.html' %}
	</td>
</tr>